<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use \think\Route;

Route::group('index',
    ['index'=>['index/index/index']]
);

Route::rule('dologin','index/Login/doLogin');

Route::group('image',[
    'waybill'=>'index/ImageController/waybillPdf',
    'upload'=>'index/ImageController/saveImage',
    'barcode'=>'index/ImageController/BarCode',
    'purchase'=>'index/ImageController/purchaseListCode',
    'down'=>'index/ImageController/download',
    'stock/out/print'=>'index/ImageController/stockOurPrint',
    'invoice/print'=>'index/ImageController/invoicePdf',
]);

Route::group('excel',[
    'product'=>'index/ExcelController/productListExcel',
    'purchased'=>'index/ExcelController/purchasedListExcel',
    'down'=>'index/ExcelController/download',
    'product/history'=>'index/ExcelController/productHistoryListExcel',
]);

Route::group('home',[
    'payment/list'=>'index/UserController/getPaymentList',
    'todo/list'=>'index/UserController/getTodoList',
    'todo/save'=>'index/UserController/saveTodoList',
    'todo/complete'=>'index/UserController/completeTodoList',
    'day/text'=>'index/UserController/getDayText',
    'news/list'=>'index/UserController/getNewsList',
    'sales/amount'=>'index/UserController/getSalesAmount',
    'customer/data'=>'index/CustomerController/customerHomeData',
]);
Route::group('notice',[
    'list'=>'index/NoticeController/getNotice',
    'param'=>'index/NoticeController/getNoticeParam',
    'title/list'=>'index/NoticeController/getNoticeTitleList',
    'add'=>'index/NoticeController/addNotice',
    'get/id'=>'index/NoticeController/getNoticeById',
    'detail/id'=>'index/NoticeController/getNoticeDetailById',
    'update'=>'index/NoticeController/updateNotice',
    'get/goods'=>'index/NoticeController/getProduct',
]);
Route::group('goods',[
    'param'=>'index/goods/getParam',
    'list'=>'index/goods/getList',
    'stockin/param'=>'index/goods/getStockInParam',
    'add'=>'index/goods/addGoods',
    'get/id'=>'index/goods/getGoodsById',
    'get/goodsId'=>'index/goods/getGoodsByGoodsId',
    'get/name'=>'index/goods/getGoodsListByName',
    'search/combination'=>'index/goods/searchGoodsList',
    'get/enName'=>'index/goods/getGoodsListByEnName',
    'by/name'=>'index/goods/getGoodsByName',
    'warehousing'=>'index/goods/updateGoodsStock',
    'changePrice'=>'index/goods/updateGoodsPrice',
    'save'=>'index/goods/updateGoods',
    'exhibition'=>'index/goods/exhibitionProduct',
    'updateAll'=>'index/goods/updateProductAll',
    'stockBatchIn'=>'index/goods/createStockBatchIn',
    'getMark'=>'index/goods/getMark',
    'addMark'=>'index/goods/addMark',
]);
Route::group('stock',[
    'out/goods'=>'index/stock/stockOutByGoodsId',
    'out/goods/batch'=>'index/stock/stockOutByGoodsIds',
    'out/invoice'=>'index/stock/stockOutByInvoice',
    'get/data'=>'index/stock/getStockOutList',
    'history/param'=>'index/stock/getStockHistoryParam',
    'history/list'=>'index/stock/getStockHistoryList',
]);
Route::group('customer',[
    'get/name'=>'index/CustomerController/getCustomerByName',
    'order/create'=>'index/CustomerController/createOrder',
    'order/create/batch'=>'index/CustomerController/createOrderBatch',
    'order/param'=>'index/CustomerController/getCustomerOrderParam',
    'param'=>'index/CustomerController/getParam',
    'list'=>'index/CustomerController/getList',
    'get/id'=>'index/CustomerController/getCustomerById',
    'fixedtags'=>'index/CustomerController/getCustomerFixedTags',
    'search/name'=>'index/CustomerController/getCustomerListByName',
    'add'=>'index/CustomerController/createCustomer',
    'update'=>'index/CustomerController/updateCustomer',
    'get/member'=>'index/CustomerController/getMemberById',
    'add/member'=>'index/CustomerController/addMember',
    'update/member'=>'index/CustomerController/updateMember',
    'record/id'=>'index/CustomerController/getRecordById',
    'getEmail'=>'index/CustomerController/getEmail',
    'merge'=>'index/CustomerController/mergeCustomer',
    'chooseMerge'=>'index/CustomerController/chooseMerge',
    'track'=>'index/CustomerController/trackRecord',
    'add/track'=>'index/CustomerController/addTrackRecord',
    'end/track'=>'index/CustomerController/endTrackRecord',
    'ends/track'=>'index/CustomerController/endsTrackRecord',
    'discount/id'=>'index/CustomerController/getDiscountById',
    'discount/save'=>'index/CustomerController/saveDiscount',
]);
Route::group('ordered',[
    'param'=>'index/OrderController/getCustomerOrderParam',
    'list'=>'index/OrderController/getCustomerOrderList',
//    'create'=>'index/OrderController/createOrderByCustomerOrder',
    'create'=>'index/OrderController/createOrder',
    'merge/create'=>'index/OrderController/createOrderMerge',
    'get/id'=>'index/OrderController/getCustomerOrderById',
    'update'=>'index/CustomerController/updateCustomerOrder',
    'cancel'=>'index/CustomerController/cancelCustomerOrder',
    'getGroup'=>'index/OrderController/getGroup',
    'updateCustomer'=>'index/OrderController/updateCustomer',
    'preview/order'=>'index/OrderController/previewCreateOrder',
//    'autoCreate'=>'index/OrderController/autoCreateOrderByCustomerOrder',
]);
Route::group('order',[
    'param'=>'index/OrderController/getOrderParam',
    'list'=>'index/OrderController/getOrderList',
    'cancel'=>'index/OrderController/cancelOrder',
    'merge'=>'index/OrderController/mergeOrder',
    'items/id'=>'index/OrderController/getOrderItemsById',
    'invoice/create'=>'index/OrderController/createInvoice',
    'invoice/batchCreate'=>'index/OrderController/batchCreateInvoice',
    'invoice/save'=>'index/OrderController/updateOrderWithCreate',
    'invoice/sent'=>'index/OrderController/sentInvoice',
    'payment/id'=>'index/OrderController/getPaymentById',
    'invoice/payment'=>'index/OrderController/recordPayment',
    'ship'=>'index/OrderController/ship',
    'invoice/split'=>'index/OrderController/splitInvoice',
    'createWaybill'=>'index/OrderController/createWaybill',
    'changeGoods'=>'index/OrderController/changeGoods',
    'orderByGoodsId'=>'index/OrderController/orderByGoodsId',
    'distributionStock'=>'index/OrderController/distributionStock',
    'remark'=>'index/OrderController/remarkOrder',
]);
Route::group('facebook',[
    'webhook'=>'index/FaceBook/webHook',
]);
Route::group('message',[
   'send'=>'index/MessageController/sendMessage',
   'list'=>'index/MessageController/getHomePageList',
   'param'=>'index/MessageController/getHomepageParam',
   'add'=>'index/MessageController/addHomePage',
   'update'=>'index/MessageController/updateHomePage',
]);
Route::group('ipn',[
    'response'=>'index/IPN/getIPNResponse',
]);
Route::group('waybill',[
    'createOrder'=>'index/HuaLeiApi/createOrder'
]);
Route::group('webhook',[
    'invoice'=>'index/IPN/getWebhookResponse',
]);
Route::group('report',[
    'param'=>'index/Finance/getReportParam',
    'cost'=>'index/Finance/getReportCostData',
    'sales'=>'index/Finance/getReportSalesData',
    'paid'=>'index/Finance/getPaidCost',
    'paidDetail'=>'index/Finance/getPaidDetail',
    'salesDetail'=>'index/Finance/getSalesDetail',
    'sell'=>'index/Finance/getSellData',
]);
Route::group('profit',[
    'param'=>'index/Finance/getProfitParam',
    'list'=>'index/Finance/getProfitData',
]);
Route::group('user',[
    'param'=>'index/UserController/getUserParam',
    'list'=>'index/UserController/getUserList',
    'get/id'=>'index/UserController/getUserById',
    'create'=>'index/UserController/createUser',
    'update'=>'index/UserController/updateUser',
]);
Route::group('menu',[
    'menu'=>'index/MenuController/getUserMenu',
    'param'=>'index/MenuController/getMenuParam',
    'create'=>'index/MenuController/createMenu',
    'byuser'=>'index/MenuController/getMenuByUser',
    'byrole'=>'index/MenuController/getMenuByRole',
    'bydetail'=>'index/MenuController/getMenuByRoleDetail',
    'bygroup'=>'index/MenuController/getMenuByGroup',
]);
Route::group('role',[
    'update'=>'index/RoleController/updateRole',
    'create'=>'index/RoleController/createRole',
    'param'=>'index/RoleController/getRoleParam',
    'byUserId'=>'index/RoleController/getUserAction',
    'byRoleId'=>'index/RoleController/getRoleAction',
    'submitUser'=>'index/RoleController/submitUser',
    'submitRole'=>'index/RoleController/submitRole',
    'submitRoleDetail'=>'index/RoleController/submitRoleDetail',
    'submitGroup'=>'index/RoleController/submitGroup',
]);
Route::group('logistics',[
    'param'=>'index/LogisticsController/getWaybillParam',
    'sendGoods'=>'index/LogisticsController/sendGoods',
    //物流商运单列表
    'getList'=>'index/LogisticsController/getLogisticsWaybillList',
    'logisticsEdit'=>'index/LogisticsController/logisticsWaybillEdit',
    'logisticsSend'=>'index/LogisticsController/logisticsWaybillSend',
    'getHistory'=>'index/LogisticsController/getHistory',
    'add/remark'=>'index/LogisticsController/addRemark',
    'mergeWaybill'=>'index/LogisticsController/mergeWaybill',
    'getLogistics'=>'index/LogisticsController/getLogistics',
    'getLogisticsById'=>'index/LogisticsController/getLogisticsById',
    'image/change'=>'index/LogisticsController/imageChange',
    'image/get/id'=>'index/LogisticsController/getImageBYId',
]);
Route::group('purchase',[
    'purchased/param'=>'index/PurchaseController/purchasedParam',
    'purchased/list'=>'index/PurchaseController/purchasedList',
    'purchased/submit'=>'index/PurchaseController/purchaseUpdateStatus',
    'purchased/unable'=>'index/PurchaseController/purchaseUpdateUnable',
    'purchased/receipt'=>'index/PurchaseController/purchaseReceipt',
    'purchased/all'=>'index/PurchaseController/getPurchasedByIds',
    'purchased/remark'=>'index/PurchaseController/addRemark',
    'purchased/updateAll'=>'index/PurchaseController/updatePurchaseDetail',
    'purchased/batchDelivery'=>'index/PurchaseController/updateBatchDelivery',
    'update/waybill'=>'index/PurchaseController/updateWaybillBatch',
    'confirm/list'=>'index/PurchaseController/confirmList',
    'confirm/param'=>'index/PurchaseController/confirmParam',
    'stock/in'=>'index/PurchaseController/stockIn',
    'list'=>'index/PurchaseController/getList',
    'product/ids'=>'index/PurchaseController/getProductByIds',
    'product/id'=>'index/PurchaseController/getProductById',
    'product/all'=>'index/PurchaseController/getProductAll',
    'add'=>'index/PurchaseController/addPurchase',
    'newPurchaseParam'=>'index/PurchaseController/getNewPurchaseParam',
    'newPurchase'=>'index/PurchaseController/newPurchase',
    'param'=>'index/PurchaseController/getParam',
    'stock/in/id'=>'index/PurchaseController/StockInById',
    'vendor/param'=>'index/PurchaseController/getVendorParam',
    'vendor/list'=>'index/PurchaseController/getVendorList',
    'vendor/add'=>'index/PurchaseController/addVendor',
    'hide'=>'index/PurchaseController/hideProduct',
    'get'=>'index/PurchaseController/getPurchaseList',
    'batchPurchase'=>'index/PurchaseController/insertBatchPurchase',
    'purchased/end'=>'index/PurchaseController/endPurchase',
]);
Route::group('vendor',[
    'get/id'=>'index/vendorController/getVendorById',
    'save'=>'index/vendorController/saveVendorInfo',
]);
//空模块控制 默认开启强制路由 所有请求必须经过route
defined('START_BUSINESS') or Route::miss('index/index/miss');

return [
    '__pattern__' => [
        'name' => '\w+',
    ],
    '[hello]'     => [
        ':id'   => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
        ':name' => ['index/hello', ['method' => 'post']],
    ],

];